package net.oschina.archx.spring.entity;

import net.oschina.archx.spring.validation.PhoneNumber;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 用户实体
 *
 * @author Archx[archx@foxmail.com]
 * @date 2016/2/25 0025
 */
public class User implements Serializable {

    private static final long serialVersionUID = 3538790730311867073L;

    @NotBlank(message = "{user.name.blank}")
    private String username;

    @NotNull(message = "{user.age.null}")
    @Range(min = 18l, max = 80l, message = "{user.age.range}")
    private Integer age;

    @PhoneNumber(message = "{user.phone.illegal}")
    private String phone;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }
}
